package com.allyes.flume.interceptor.rawlogdigger;

import static com.allyes.flume.interceptor.rawlogdigger.RawlogDiggerConstants.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.allyes.flume.interceptor.RawlogInterceptor;

public class RawlogDiggerFactory {
  private static final Logger logger = LoggerFactory.getLogger(RawlogInterceptor.class);

  public static RawlogDigger newInstance(String name) {
    switch (name) {
      case TXT_TIMESTAMP:
        return new RawlogDigger_Timestamp();
      case TXT_PRODUCT:
        return new RawlogDigger_Product();
      case TXT_DB:
        return new RawlogDigger_Db();
      default:
        logger.warn("Invaid type of RawlogDigger: " + name);
        return null;
    }
  }

}
